#define _CRT_SECURE_NO_WARNINGS
#include"vector.h"

void test_vector1(lbj::vector<int> vec)
{
	for (size_t i=0;i<vec.size();i++)
	{
		cout << vec[i] << " ";
	}
	cout << endl;
}

void test_vector2(lbj::vector<int> vec)
{
	for (auto num : vec)
	{
		cout << num << " ";
	}
	cout << endl;
	lbj::vector<int>::iterator it = vec.begin();
	while (it != vec.end())
	{
		*it *= 2;
		cout << *it << " ";
		it++;
	}
	cout << endl;
}

void test_vector3(lbj::vector<int> vec)
{
	for (size_t i = 0; i < vec.size(); i++)
	{
		cout << vec[i] << " ";
	}
	cout << endl;
	vec.resize(10, 0);
	for (size_t i = 0; i < vec.size(); i++)
	{
		cout << vec[i] << " ";
	}
	cout << endl;
}

void test_vector4(lbj::vector<int> vec)
{
	for (size_t i = 0; i < vec.size(); i++)
	{
		cout << vec[i] << " ";
	}
	cout << endl;
	vec.insert(vec.begin() + 3, 30);
	vec.insert(vec.begin() + 3, 40);
	vec.insert(vec.begin() + 3, 50);
	vec.insert(vec.begin() + 3, 60);
	vec.insert(vec.begin() + 3, 70);
	vec.insert(vec.begin() + 3, 80);

	for (size_t i = 0; i < vec.size(); i++)
	{
		cout << vec[i] << " ";
	}
	cout << endl;

}

void test_vector5(lbj::vector<int> vec)
{
	for (size_t i = 0; i < vec.size(); i++)
	{
		cout << vec[i] << " ";
	}
	cout << endl;
	lbj::vector<int>::iterator it = vec.begin() + 3;
	vec.erase(it);
	for (size_t i = 0; i < vec.size(); i++)
	{
		cout << vec[i] << " ";
	}
	cout << endl;
	vec.pop_back();
	vec.pop_back();
	vec.pop_back();
	for (size_t i = 0; i < vec.size(); i++)
	{
		cout << vec[i] << " ";
	}
	cout << endl;
}

int main()
{
	lbj::vector<int> v;
	v.push_back(4);
	v.push_back(5);
	v.push_back(6);
	v.push_back(7);
	v.push_back(3);
	v.push_back(2);

	test_vector5(v);

	return 0;
}